package com.viettel.synctask;

import java.util.ArrayList;

import android.os.AsyncTask;
import android.util.Log;

import com.viettel.BO.CandidateBean;
import com.viettel.BO.RecruitmentAnouncementBean;
import com.viettel.data.CandidateFetcher;
import com.viettel.rmsmobile.CandidateCareerFragment;

public class CandidateSyncTask extends
		AsyncTask<Object, Boolean, ArrayList<CandidateBean>> {

	CandidateCareerFragment careerFragment;

	@Override
	protected ArrayList<CandidateBean> doInBackground(Object... params) {
		careerFragment = (CandidateCareerFragment) params[0];
		Long portalUserId = (Long) params[1];
		CandidateFetcher candidateFetcher = new CandidateFetcher(portalUserId);
		return candidateFetcher.getList();
	}

	@Override
	protected void onPostExecute(ArrayList<CandidateBean> response) {
		try {
			careerFragment.setJoblist(response);
		} catch (Exception e) {
			Log.d("Error: ", " " + e.getMessage());
		}
		super.onPostExecute(response);
	}
}
